﻿//*** Guidance generated code ***//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Resources;

using ProjectBase.Core;

namespace Survey.Common.Providers
{
    /// <summary>
    ///     allows to use syntax 'meta:resourceKey="Detail"'.
    ///     ATTENTION: Keep in mind that Detail.Text (Detail.ToolTip) is searched this way ...
    /// </summary>
    public class ResourceReader : IResourceReader
    {
        #region members
        readonly IDictionary _resources;
        #endregion members

        #region constructor
        /// <summary>
        ///     Expects the collection of current culture and area
        /// </summary>
        /// <param name = "resources"></param>
        public ResourceReader(IDictionary resources)
        {
            _resources = resources;
        }
        #endregion constructor

        #region IResourceReader
        public IDictionaryEnumerator GetEnumerator()
        {
            return _resources.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return _resources.GetEnumerator();
        }

        public void Close() { }
        public void Dispose()
        {
            Dispose(true);
        }
        protected virtual void Dispose(bool disposed) { }
        #endregion IResourceReader
    }
}